﻿package com.videointeractive.main
{
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	import flash.display.Sprite;
	
	import flash.text.TextField;
	
	import com.videointeractive.conf.VideoSequencesConf;
	
	import com.videointeractive.manager.VideoManager;
	
	import com.videointeractive.tool.VideoTrackBar;
	
	import flash.system.fscommand;


	
	public class VideoInteractive extends Sprite
	{
		public var video 	: Sprite;
		
		public var bg		: Background = new Background( );
		
		public var tb		: VideoTrackBar;
		
		private var _waitingText:TextField;
		
		public function VideoInteractive ( )
		{
			flash.system.fscommand("allowScale", "false");
			stage.scaleMode = "noScale";
			
			video = new VideoManager( );
			VideoManager( video ).loadFLV( VideoSequencesConf.DEFAULT_VIDEO_URL  );
			
			addChild( bg );
			addChild( video );
		}
		
		private function resetVideo ( pEvt : MouseEvent ) : void
		{
			if ( ! VideoManager( video ).isPlaying )
				VideoManager( video ).playFLV( );
			
			VideoManager( video ).resetVideo( );
		}
	}
}